# -*- coding: utf-8 -*-
import pygame
pygame.init()
fpsClock = pygame.time.Clock()
screen = pygame.display.set_mode((800,600))
pygame.display.set_caption("Ex17.6")
bg1 = pygame.Color(0,0,0)
bg2 = pygame.Color(255,255,255)
cnt = 0
page = 0
running = True
while running:
    fpsClock.tick(30)
    if page == 0:
        screen.fill(bg1)
    else:
        screen.fill(bg2)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    cnt = cnt+1
    if cnt == 30:
        cnt = 0
        if page == 0:
            page = 1
        else:
            page = 0
    pygame.display.flip()
pygame.quit()